import React from 'react'
import { Button, Input, Form } from 'react-vant'
import axios from 'axios'
export default () => {
    const [form] = Form.useForm()

    const onFinish = (values: any) => {
        console.log(values)
        axios.post("http://localhost:3002/register", values).then((res) => {
            console.log(res);
        });
    }
    return (
        <div>
            <Form
                form={form}
                onFinish={onFinish}
                footer={
                    <div style={{ margin: '16px 16px 0' }}>
                        <Button round nativeType='submit' type='primary' block>
                            注册
                        </Button>
                    </div>
                }>
                <Form.Item
                    name='username'
                    label='用户名'>
                    <Input placeholder='请输入用户名' />
                </Form.Item>
                <Form.Item
                    name='password'
                    label='密码'>
                    <Input placeholder='请输入密码' />
                </Form.Item>
                <Form.Item
                    name='email'
                    label='邮箱'>
                    <Input placeholder='请输入邮箱' />
                </Form.Item>
                <Form.Item
                    name='age'
                    label='年龄'>
                    <Input placeholder='请输入年龄' />
                </Form.Item>
                <Form.Item
                    name='address'
                    label='地址'>
                    <Input placeholder='请输入地址' />
                </Form.Item>
            </Form>
        </div>

    )
}


